<template id="child">
  <div>
    <div>用户输入: {{value}}</div>
    <div>
      <el-button @click="add">加1</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "EmitCmp",
  props: {
    value: {
      type: Number,
      default: 1
    },
  },
  data() {
    return {}
  },
  methods: {
    add() {
      this.$emit("child-fn", this.value + 1)
    }
  }
}
</script>